<template>
	<view class="order_detail">
		<view class="detail">
			<view class="top">
				<view class="left">
					<image class="avatar" :src="orderdetail.avatar" mode="widthFix"></image>
					<text>{{ orderdetail.nickname }}</text>
				</view>
				<view class="right">
					<image @click="call(orderdetail.mobile)" src="https://chazhichashi.rchz.top/img/phone_g.png"
						mode="widthFix"></image>
				</view>
			</view>
			<view class="money">
				<text style="font-size: 36rpx;">￥{{ orderdetail.total_price }}</text>
				<text style="color: #45bb52; font-size: 24rpx;">
					{{
						orderdetail.status == 10
							? '待支付'
							: orderdetail.status == 20
							? '已取消'
							: orderdetail.status == 30
							? '已预约'
							: orderdetail.status == 29
							? '已转让'
							: orderdetail.status == 31
							? '进行中'
							: '已完成'
					}}
				</text>
			</view>
			<view class="list">
				<view class="item" @click="toDetail(orderdetail.id)">
					<view class="bottom">
						<view class="lists">开始时间：{{ orderdetail.start_time }}</view>
						<view class="lists">店铺名称：{{ orderdetail.store_name }}</view>
						<view class="lists">地址：{{ orderdetail.address }}</view>
					</view>
				</view>
			</view>
			<view class="bottom">
				<view class="">打卡拍照图片:</view>
				<image v-if="orderdetail.clockimg" :src="orderdetail.clockimg" mode="widthFix"></image>
				<view v-else class="">暂未上传照片</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderid: '',
				orderdetail: {}
			};
		},
		onLoad(e) {
			this.orderid = e.orderid;
			this.getDetail();
		},
		methods: {
			call(mobile) {
				uni.makePhoneCall({
					phoneNumber: mobile //仅为示例
				});
			},
			toDetail(id) {

			},
			getDetail() {
				this.https('/order/masterOrderDetail', { orderid: this.orderid }).then(res => {
					this.orderdetail = res.data;
				});
			}
		}
	};
</script>

<style lang="scss">
	page {
		background-color: #f5f5f5;
	}

	.money {
		display: flex;
		justify-content: space-between;
		margin-top: 16rpx;
	}

	.order_detail {
		padding: 32rpx;
	}

	.detail {
		background-color: #fff;
		border-radius: 16rpx;
		padding: 32rpx;

		.top {
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 32rpx;
			font-weight: 500;

			.left {
				display: flex;
				justify-content: start;
				align-items: center;
			}

			.right {
				image {
					width: 48rpx;
				}
			}

			.avatar {
				width: 64rpx;
				border-radius: 50%;
			}
		}

		.list {
			.item {
				border-radius: 16rpx;
				background-color: #fff;

				.top {
					font-size: 32rpx;
					color: #1d2129;
					display: flex;
					align-items: center;
					font-weight: 500;

					image {
						width: 64rpx;
						margin-right: 16rpx;
						border-radius: 50%;
					}
				}

				.bottom {
					font-size: 24rpx;
					color: #4e5969;
					padding: 12rpx 0 12rpx 0;
					border-bottom: 1rpx solid #e7e7e7;

					.lists {
						padding: 12rpx 0;
					}
				}

				.btns {
					padding: 16rpx 0 0 0;
					font-size: 24rpx;
					display: flex;
					justify-content: space-between;

					.money {
						font-weight: bold;
						font-size: 36rpx;
					}

					.buttons {
						display: flex;
						justify-content: end;
						align-items: center;

						.button {
							width: 112rpx;
							height: 56rpx;
							border-radius: 52rpx;
							opacity: 1;
							text-align: center;
							line-height: 52rpx;
							color: #45bb52;
							border: 2rpx solid #45bb52;
							margin-left: 16rpx;
						}
					}
				}
			}
		}

		.bottom {
			font-size: 24rpx;
			color: #4e5969;
			padding: 12rpx 0 12rpx 0;

			image {
				margin-top: 16rpx;
				width: 100%;
			}
		}
	}
</style>